package com.csyf.manager.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.ToString;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: Enzo
 * @Date: 2018/3/30 11:07
 */
@Data
@Table(name = "sys_payment")
@ToString
public class SysPayment {

    @Excel(name = "商户号", orderNum = "0",width = 25D)
    private String mchId;
    @Excel(name = "订单号", orderNum = "1", width = 40D)
    @Id
    private String outTradeNo;
    @Excel(name = "姓名", orderNum = "5", width = 12D)
    private String accountName;
    @Excel(name = "卡号", orderNum = "6", width = 12D)
    private String bankCard;
    private String bankname;
    private String banklinked;
    @Excel(name = "交易金额", orderNum = "3", width = 12D,type = 10)
    private BigDecimal transmoney;
    @Excel(name = "交易状态", orderNum = "8", replace = {"交易失败_2", "等待支付_1", "交易成功_3"})
    private String payStatus;
    private String payType;
    private String agentName;
    private String srcMchId;
    @Excel(name = "类型", orderNum = "2", width = 20D)
    private String service;
    @Excel(name = "交易信息", orderNum = "9",  width = 20D)
    private String srcReason;
    @Excel(name = "创建时间", orderNum = "7",  width = 20D,format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @Excel(name = "交易手续费", orderNum = "4", width = 8D,type = 10)
    private BigDecimal free;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date payTime;


    private Integer failCount;

    private String srcOrderno;

    @Transient
    private String createTimeString;

    @Transient
    private String endTimeString;

}
